﻿@page "/"
@inject IWebHostEnvironment _hostEnvironment
@inject IJSRuntime JSRuntime
<PageTitle>Index</PageTitle>
<style>
    body {
        background-image: url(森林.jpg);
        background-size: cover;
        overflow: hidden;
    }
</style>
<script src="/javascript/handle.js"></script>
@code {
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {

        if (firstRender)
        {
            await JSRuntime.InvokeVoidAsync("import", "/xy.js");
        }

    }
}
@if (Bo)
{
    <div class="frosted-glass">
        <h1 class="title" id="currentTime"></h1>
        <div class="frosted-glass2">
            <button class="transparent-button" @onclick="DownloadPDF">下载 PDF</button>
            &nbsp; &nbsp; &nbsp;
            <input class="transparent-input" placeholder="输入内容" @bind-value="PrintUrl" ID="PrintUrl" />
            &nbsp; &nbsp; &nbsp;
            <button class="transparent-button" type="button" @onclick="@(e=> GoToLocal("1"))">提  交</button>
            &nbsp; &nbsp; &nbsp;
            <button class="transparent-button" type="button" @onclick="@(e=> GoToLocal("2"))">本地PDF</button>
            &nbsp; &nbsp; &nbsp;
            <button class="transparent-button" type="button" @onclick="TogglePDF" id="Shou">收 起</button>

        </div>
    </div>
}
else
{
    <div class="Zhan"><button class="button" @onclick="TogglePDF">展  开</button></div>
}

@if (_PDF)
{
    <div class="DivPDF">

        <iframe id="PDf" class="PDF" src="@PrintPDF"></iframe>
    </div>
}
<canvas id="rain"></canvas>
<Loading @ref="loadingModal" IsLoading="IsLoading"></Loading>